Skip to content

Resolve additional test failures for c2 branch#21656

Merged
adfoster-r7 merged 1 commit into
rapid7:6.5from
adfoster-r7:patch-additional-c2-errors
Jul 9, 2026
Merged

Resolve additional test failures for c2 branch#21656
adfoster-r7 merged 1 commit into
rapid7:6.5from
adfoster-r7:patch-additional-c2-errors

Conversation

@adfoster-r7

Copy link
Copy Markdown
Contributor

Patching additional c2 errors

@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 3 times, most recently from 8955f11 to 5a185c0 Compare July 7, 2026 22:33
@adfoster-r7 adfoster-r7 requested a review from Copilot July 7, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses additional test failures on the C2 branch by adjusting acceptance expectations, expanding payload cache-size consistency coverage, and applying a few payload/CI fixes aimed at stabilizing Meterpreter-related tests across platforms.

Changes:

  • Expanded spec/modules/payloads_spec.rb to cover cached-size consistency for additional Java and PHP Meterpreter payloads.
  • Updated PHP Meterpreter single payloads to include Msf::Sessions::MeterpreterOptions::Php (language-specific options module).
  • Adjusted CI workflows to support building against a configurable metasploit-payloads repository/commit (but currently introduces hardcoded fork/branch usage in meterpreter_acceptance.yml).

Impact Analysis:

  • Blast radius: medium — affects CI signal for Meterpreter acceptance, and alters behavior in shared payload code paths (MachO#sign) used by macOS payload generation.
  • Data and contract effects: low — no schema changes; however, CI contract/inputs behavior is impacted by the hardcoded repo/commit in meterpreter_acceptance.yml.
  • Rollback and test focus: rollback is straightforward (workflow + small library/module changes); prioritize validating Meterpreter acceptance workflows (repo/commit selection + build gating) and macOS Mach-O signing correctness on Linux runners.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/support/acceptance/session/php.rb Removes an OSX known-failure entry for a PHP session acceptance case.
spec/modules/payloads_spec.rb Adds cached-size consistency specs for additional Java and PHP Meterpreter payloads.
modules/payloads/singles/php/meterpreter_reverse_http.rb Switches to PHP-specific Meterpreter options mixin.
modules/payloads/singles/php/meterpreter_reverse_https.rb Switches to PHP-specific Meterpreter options mixin.
lib/rex/proto/http/server.rb Comment-only ASCII punctuation change.
lib/rex/proto/http/request.rb Comment-only change (removes non-ASCII shrug).
lib/msf/core/payload/malleable_c2.rb Comment-only ASCII punctuation changes.
lib/msf/core/payload/macho.rb Preserves original Mach-O bytes and uses them for signing to avoid ruby-macho serialize issues on Linux.
lib/msf/core/payload/java/meterpreter_loader.rb Comment-only ASCII punctuation changes.
lib/msf/core/handler/reverse_http.rb Comment-only ASCII punctuation changes.
lib/msf/base/sessions/mettle_config.rb Comment-only ASCII punctuation change.
.github/workflows/shared_meterpreter_acceptance.yml Adds an input to select the metasploit-payloads repository and tweaks job naming/comments.
.github/workflows/meterpreter_acceptance.yml Changes defaults and (currently) hardcodes a fork/branch + forces builds (needs correction).
.github/workflows/command_shell_acceptance.yml Updates default metasploit-payloads commit to 6.5.
Comments suppressed due to low confidence (1)

.github/workflows/meterpreter_acceptance.yml:69

  • Critical: Problem: The meterpreter_acceptance workflow hardcodes a fork/branch for metasploit-payloads and forces payload/mettle builds on every run, ignoring workflow_dispatch inputs and PR labels. Impact: CI will run against non-upstream payload sources and do extra compilation work, making results unreliable and increasing runtime/cost. Fix: Pass through the workflow inputs and restore label-gated build flags (and rely on shared workflow defaults for the repo).
  build:
    uses: ./.github/workflows/shared_meterpreter_acceptance.yml
    with:
      metasploit_payloads_repo: adfoster-r7/metasploit-payloads
      metasploit_payloads_commit: update-php-meterpreter-errors
      mettle_commit: ${{ github.event.inputs.mettle_commit || '6.5' }}
      build_metasploit_payloads: true
      build_mettle: true

@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 4 times, most recently from 78333fd to e70625c Compare July 7, 2026 23:48
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 4 times, most recently from 04ae89e to af16317 Compare July 8, 2026 11:14
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 5 times, most recently from e016a13 to d5604fe Compare July 8, 2026 16:22
known_failures: [
"[-] FAILED: should return a list of processes"
]
known_failures: []

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -109,19 +109,22 @@ jobs:
tools: none

- name: Install system dependencies (Windows)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was silently broken when pointing towards the custom 6.5 branches

shell: cmd
shell: pwsh
if: runner.os == 'Windows'
run: |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was silently broken when pointing towards the custom 6.5 branches

# block. Catch the overflow here with a useful message instead of
# letting the gem's `to_binary` raise a generic "config block too
# large" baked-in EXTENSIONS= is the usual culprit.
# large" -- baked-in EXTENSIONS= is the usual culprit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting rid of non-ascii chars which aren't allowed in modules

@adfoster-r7 adfoster-r7 marked this pull request as ready for review July 8, 2026 16:27
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 2 times, most recently from 3060458 to d5f54a8 Compare July 8, 2026 17:22
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 7 times, most recently from 610a280 to e569df0 Compare July 9, 2026 10:00
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch from e569df0 to 082d99f Compare July 9, 2026 10:17
@adfoster-r7

Copy link
Copy Markdown
Contributor Author

Looks like windows 2022 has been failing since pre5, but passed on pre4 - will merge this in, and resolve/debug that separately

Comment thread Gemfile.lock
metasploit-credential (>= 6.0.21)
metasploit-model
metasploit-payloads (= 2.0.245)
metasploit-payloads (= 2.0.246.pre.7)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like windows 2022 has been failing since pre5, but passed on pre4 - will merge this in, and resolve/debug that separately

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Jul 9, 2026
@adfoster-r7 adfoster-r7 merged commit e13e920 into rapid7:6.5 Jul 9, 2026
67 of 68 checks passed
@adfoster-r7 adfoster-r7 deleted the patch-additional-c2-errors branch July 9, 2026 10:59
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Jul 9, 2026
@adfoster-r7 adfoster-r7 added the rn-no-release-notes no release notes label Jul 9, 2026
@cgranleese-r7 cgranleese-r7 self-assigned this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn-no-release-notes no release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants